package com.ytxx.fit.project.controller;

import com.ytxx.fit.project.entity.User;
import com.ytxx.fit.project.service.UserService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * @author sxm09
 * @className UserController
 * @description TODO
 * @date 2022/2/25
 */
@Api(tags = "接口集")
@RestController
@RequestMapping(value = "userManger", produces = "application/json; charset=utf-8")
public class UserController {

    @Autowired
    UserService userService;

    @ApiOperation(value = "数据库测试新增接口")
    @RequestMapping(value = "add",method = RequestMethod.POST)
    public String userTest(@RequestBody User user) {
        System.out.println("小丁真可爱 ");
        String message="";
        int res = userService.add(user);
        if (res>0){
            message="数据库新增成功";
        }
        return message;
    }
}
